<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/mui.min.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/details.css">
	<script src='js/vue.js'></script>
	<script src='js/axios.js'></script>
    <title>文章详情</title>
</head>
<body>
<header class="mui-bar mui-bar-nav head">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title nav-tit">文章详情</h1>
</header>
<main>
    <div class="mui-content main">
        <div class="outside">
            <!--标题-->
            <p class="title">{{arr.title}}</p>
            <!--出版社名字-->
            <p class="name">{{arr.create_at}}</p>
            <!--文章内容-->
            <p class="content">{{arr.content}}</p>
            <p class="content"></p>
            <!--图片-->
            <img :src="arr.image" alt="">
        </div>
    </div>
</main>
<footer>

</footer>
<script src="js/mui.min.js"></script>
<script type="text/javascript" charset="utf-8">

const API_PROXY = 'https://bird.ioliu.cn/v1/?url='
        new Vue({
            el: '.outside',
            data: {
				id:'',
				arr : []
            },
            created() {
				this.invite();
            },
            methods: {
				invite(){  
					 function getQueryString(name){  
						var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");  
						var r = window.location.search.substr(1).match(reg);  
						if(r!=null)return unescape(r[2]);return null;  
					 }  
					 this.id=getQueryString("id");
					 this.getDetails();
					 // console.log(this.id);
				 },
				 // 根据ID请求数据
				 getDetails() {
                    axios.post(API_PROXY + 'mingpian.32one.top/Index/Index/articleInfo',`articleId=${this.id}`)
                        .then(res => {
                            console.log(res);
							this.arr = res.data.data;
                        }, err => {
                            console.log(err);
                        })
                },
            }
        })
</script>
</body>

</html>